<?php
defined('_JEXEC') or die('Restricted access');
require_once(JPATH_COMPONENT.DS.'persistencia'.DS.'DAOCategory.php');
require_once(JPATH_COMPONENT.DS.'persistencia'.DS.'tables'.DS.'categoria.php');
require_once(JPATH_COMPONENT.DS.'dominio'.DS.'DTOFactory.php');

class JDAOCategory implements DAOCategory{
	public function getCategories(){
		$listaCategorias = $this->multipleObjectQuery("SELECT * FROM #__categoria");
		$factoria=DTOFactory::getInstance();
		$listaDtoEvent=$factoria->fromObjectList2DTOCategoryList($listaCategorias);
		return $listaDtoEvent;
	}
	private function multipleObjectQuery($query){
		$db =& JFactory::getDBO();
		$db->setQuery($query);
		return $db->loadObjectList();
	}
}
?>